<template>
  <div class="HeaderPage">
    <el-row>
      <el-col :span="1">
        <div style="height: 50px;padding-top: 10px;">
          <img src="@/assets/logo.png" width="40px" height="40px" @click='OpenIsCollapse'/>
        </div>
      </el-col>
      <el-col :span="21" style="text-align: left;">
        <span style="font-size:20px;font-weight: 500px;">测试管理系统</span>
      </el-col>
      <el-col :span="2">
        <div style="height:50px;padding-top: 10px;">
          <div style="float:left">
            <el-avatar
              src="https://blogimage-1255495010.cos.ap-beijing.myqcloud.com/202210111546361.jpg"
              :size="40"
            ></el-avatar>
          </div>
          <div style="line-height:40px;">
            <el-dropdown trigger="click">
              <span class="el-dropdown-link">
                Harris<i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item icon="el-icon-user">用户信息</el-dropdown-item>
                <el-dropdown-item icon="el-icon-user">修改密码</el-dropdown-item>
                <el-dropdown-item icon="el-icon-place">退出系统</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  name: 'HeaderPage',
  data () {
    return {
      isCollapse: false
    }
  },
  methods: {
    switchchange (data) {
      if (data === true) {
        data = false
      } else {
        data = true
      }
      this.$bus.$emit('changeEvent', { a: data })
    },
    OpenIsCollapse () {
      if (this.isCollapse === true) {
        this.isCollapse = false
      } else {
        this.isCollapse = true
      }
      this.$bus.$emit('changeEvent', { a: this.isCollapse })
    }
  }
}
</script>
<style scoped lang="scss">
.HeaderPage{
  color: white;
}
.collapseClass {
  text-align: left;
}
.el-dropdown-link{
  color: white;
}
</style>
